﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Xqsys.BLL
{
    public class Users
    {
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public bool AddUser(MODEL.Users user)
        {
            return new Xqsys.DAL.Users().AddUser(user);
        }
        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public bool UpdateUser(MODEL.Users user)
        {
            return new DAL.Users().UpdateUser(user);
        }
        /// <summary>
        /// 判断用户是否存在
        /// </summary>
        /// <param name="name"></param>
        /// <returns>false不存在</returns>
        public bool ExistUserName(string name)
        {
            return new DAL.Users().ExistUserName(name);
        }
        /// 用户登录
        /// </summary>
        /// <param name="user"></param>
        /// <returns>用户密码</returns>
        public DataSet Login(MODEL.Users user)
        {
            return new DAL.Users().Login(user);
        }
        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns>用户所有资料</returns>
        public DataSet SelectUserID(MODEL.Users user)
        {
            return new DAL.Users().SelectUserID(user);
        }
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="user">用户</param>
        /// <returns>bool是否成功</returns>
        public bool ChangerPwd(MODEL.Users user)
        {
            return new DAL.Users().ChangerPwd(user);
        }
        /// <summary>
        /// 管理用户
        /// </summary>
        /// <returns>用户列表</returns>
        public DataSet GetAllList()
        {
            return new DAL.Users().GetAllList();
        }
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="user">用户id</param>
        /// <returns>是否成功bool</returns>
        public bool DeleteUser(MODEL.Users user)
        {
            return new DAL.Users().DeleteUser(user);
        }
        /// <summary>
        /// 管理用户 更新
        /// </summary>
        /// <param name="user"></param>
        /// <returns>bool 是否成功</returns>
        public bool UpDating(MODEL.Users user)
        {
            return new DAL.Users().UpDating(user);
        }
    }
}
